//
//  FooterView.m
//  CarTown
//
//  Created by xionghao on 15/8/27.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "FooterView.h"

@implementation FooterView
-(instancetype)init{
    if (self=[super init]) {
        UILabel *lable=[[UILabel alloc]init];
        _lable=lable;
        _lable.frame=CGRectMake(16, 16, XHScreenwidth-32, 0);
        _lable.font=[UIFont systemFontOfSize:14];
        _lable.numberOfLines=0;
        _lable.textColor=textnormalGary;
        self.frame=CGRectMake(0, 0, XHScreenwidth, 0);
        self.backgroundColor=bgGarycolor;
        [self addSubview:_lable];
    }
    return self;
}
-(void)setFootstr:(NSString *)footstr{
    _footstr=footstr;
    NSDictionary *attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:14]};
    
    CGSize labelSize = [_footstr boundingRectWithSize:CGSizeMake(self.lable.width, 0) options: NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:attribute context:nil].size;
  self.lable.height=labelSize.height;
  self.height=labelSize.height+32;
    self.lable.text=_footstr;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
